<!--发布成果-->
<template>
	<view >
		<view v-if="!editeId"  class="ma-20 white round-5 c_yy">
			<tm-input @click="showCategory=!showCategory" transprent prefixLabel="发布类型" :margin="[0,10]" :padding="[0, 0]"
			    :input-padding="[24, 0]" :height="88" :round="5" 
				:model-value="'发布'+category[categoryIndex].title"
				 align="right" disabled placeholder="请选择">
				<template v-slot:right>
					<view class="ml-20">
						<tm-icon color="#C8C8C8" :font-size="28" name="tmicon-angle-right"></tm-icon>
					</view>
				</template>
			</tm-input>
		</view>
		
		<xuqiu :id="editeId" v-if="typeId=='demand'"></xuqiu>
		<chengguo :id="editeId" v-if="typeId=='achieved'"></chengguo>
		<fuwu :id="editeId" v-if="typeId=='service'"></fuwu>
		<touzi :id="editeId" v-if="typeId=='investment'"></touzi>
		<rongzi :id="editeId" v-if="typeId=='financing'"></rongzi>
		<tundui :id="editeId" v-if="typeId=='team'"></tundui>
		
		<tm-action-menu @change="typeChange" v-model="showCategory" v-model:active="categoryIndex" rang-key="title"
		:list="category"></tm-action-menu>
	</view>
</template>

<script lang="ts" setup>
import { ref } from "vue"
import xuqiu from './components/xuqiu.vue'
import chengguo from './components/chengguo.vue'
import fuwu from './components/fuwu.vue'
import touzi from './components/touzi.vue'
import rongzi from './components/rongzi.vue'
import tundui from './components/tundui.vue'
import { onLoad } from "@dcloudio/uni-app"
import { apiUr } from "@/libs/api"

const category = [
	{ title: "需求", name: "demand" },
	{ title: "服务", name: "service" },
	{ title: "成果", name: "achieved" },
	{ title: "投资", name: "investment" },
	{ title: "团队", name: "team" },
	{ title: "融资", name: "financing" },
]
const categoryIndex = ref(0)
const showCategory = ref(false)
const typeId = ref("demand")
const editeId = ref("")
function typeChange(key: any) {
	typeId.value = key.name;
}

onLoad((obj:any)=>{
	if(obj?.id){
		editeId.value = obj?.id
		typeId.value = obj?.apiname
		uni.setNavigationBarTitle({title:"编辑信息"})
	}
})



</script>
<style>
page,
body {
	background-color: #FFFFFF;
}
</style>

<style lang="less" scoped>
	.c_yy{
		box-shadow: 0rpx 3rpx 16rpx 0rpx rgba(0, 0, 0, 0.05);
	}
</style>